import java.util.Objects;

class RnaTranscription {

    String transcribe(String dnaStrand) {

        if (null == dnaStrand) {
            throw new IllegalArgumentException("Invalid input");
        }

        if (dnaStrand.indexOf('U') >= 0 || dnaStrand.indexOf('X') >= 0){
            throw new IllegalArgumentException("Invalid input");
        }

        char[] dnaCharArray = dnaStrand.toCharArray();

        for (int i = 0; i < dnaCharArray.length; i++) {
            switch (dnaCharArray[i]) {
                case 'C':
                    dnaCharArray[i] = 'G';
                    break;
                case 'G':
                    dnaCharArray[i] = 'C';
                    break;
                case 'T':
                    dnaCharArray[i] = 'A';
                    break;
                case 'A':
                    dnaCharArray[i] = 'U';
                    break;
            }
        }

        return String.valueOf(dnaCharArray);
    }

}
